package device

import (
	"alarm_service/internal/db"
	"alarm_service/internal/models"
)

type Repo interface {
	GetDeviceByIdentifier(identifier string) (*models.Device, error)
	SetDeviceByInfo(deviceInfo *models.Device) error
	SetHeartBeat(id int) error
	SetPhones(id int, phones []string) error
	SetMessageSwitch(id int, onOff uint8) error
	SetRecover(id int) error
	SetPhoneSwitch(id int, onOff uint8) error
	SetOffline(id int)
}

func NewRepo(db *db.DB) Repo {
	r := &DeviceRepo{
		DB: db.DB,
	}
	return r
}
